package org.chs.ts.system.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.willa.business.sys.entity.SysRole;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author wuwei
 * @date 2024/1/3
 * @apiNote
 */
@ApiModel(description = "前台系统用户新增对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "SysUserInsVO")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
public class SysUserVO {
    /**
     * 登录账号
     */
    @NotNull(message = "缺少必要的参数规则username")
    @NotBlank(message = "登录账号不能为null，或者只包含空格")
    @NotEmpty(message = "登录账号不能为null或者长度为0")
    @ApiModelProperty(value = "登录账号", position = 1)
    @JSONField(name = "username")
    private String username;
    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名", position = 2)
    @JSONField(name = "realname")
    private String realname;
    /**
     * 密码
     */
    @NotNull(message = "缺少必要的参数规则password")
    @NotBlank(message = "密码不能为null，或者只包含空格")
    @NotEmpty(message = "密码不能为null或者长度为0")
    @ApiModelProperty(value = "密码", position = 3)
    @JSONField(name = "password")
    private String password;

    /**
     * 生日
     */
    @ApiModelProperty(value = "生日", position = 5)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "birthday")
    private Date birthday;
    /**
     * 性别(0-默认未知,1-男,2-女)
     */
    @ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)", position = 6)
    @JSONField(name = "sex")
    private long sex;
    /**
     * 电子邮件
     */
    @ApiModelProperty(value = "电子邮件", position = 7)
    @JSONField(name = "email")
    private String email;
    /**
     * 电话
     */
    @NotNull(message = "缺少必要的参数规则phone")
    @NotBlank(message = "电话不能为null，或者只包含空格")
    @NotEmpty(message = "电话不能为null或者长度为0")
    @ApiModelProperty(value = "电话", position = 8)
    @JSONField(name = "phone")
    private String phone;
    /**
     * 登录会话的机构编码
     */
    @ApiModelProperty(value = "登录会话的机构编码", position = 9)
    @JSONField(name = "orgCode")
    private String org_code;


    /**
     * 工号，唯一键
     */
    @ApiModelProperty(value = "工号，唯一键", position = 15)
    @JSONField(name = "workNo")
    private String work_no;

    /**
     * 职务，关联职务表
     */
    @ApiModelProperty(value = "职务，关联职务表", position = 16)
    @JSONField(name = "post")
    private String post;
    /**
     * 座机号
     */
    @ApiModelProperty(value = "座机号", position = 17)
    @JSONField(name = "telephone")
    private String telephone;
    /**
     * 负责部门
     */
    @ApiModelProperty(value = "负责部门", position = 18)
    @JSONField(name = "departIds")
    private String depart_ids;

    /**
     * 角色列表
     */
    @ApiModelProperty(value = "角色列表", position = 19)
    @JSONField(name = "roleList")
    private List<SysRole> roleList;

}
